// Date: 2021-03-24
/**
 * 用户是否冻结 NORMAL：正常 FROZEN：冻结
 */
export const USER_IS_FROZEN = {
  NORMAL: 'NORMAL',
  FROZEN: 'FROZEN',
} as const;
export type USER_IS_FROZEN_TYPE = typeof USER_IS_FROZEN[keyof typeof USER_IS_FROZEN];

/**
 * 用户是否管理员 NO：否 YES：是
 */
export const USER_IS_ADMIN = {
  NO: 'NO',
  YES: 'YES',
} as const;
export type USER_IS_ADMIN_TYPE = typeof USER_IS_ADMIN[keyof typeof USER_IS_ADMIN];

/**
 * 验证码类型 REGISTER：注册 UPDATE：修改
 */
export const CAPTCHA_TYPE = {
  REGISTER: 'REGISTER',
  UPDATE_PASSWORD: 'UPDATE_PASSWORD',
  UPDATE_INFO: 'UPDATE_INFO',
} as const;
export type CAPTCHA_TYPE_TYPE = typeof CAPTCHA_TYPE[keyof typeof CAPTCHA_TYPE];

/**
 * 删除标识 NORMAL：正常 DELETE：删除
 */
export const DEL_FLAG = {
  NORMAL: 0,
  DELETE: 1,
} as const;
export type DEL_FLAG_TYPE = typeof DEL_FLAG[keyof typeof DEL_FLAG];

/**
 * 系统标识 SYSTEM：系统 BUSINESS：业务
 */
export const DICT_SYSTEM_FLAG = {
  SYSTEM: 'SYSTEM',
  BUSINESS: 'BUSINESS',
} as const;
export type DICT_SYSTEM_FLAG_TYPE = typeof DICT_SYSTEM_FLAG[keyof typeof DICT_SYSTEM_FLAG];

/**
 * 状态标识 ENABLE：启用 DISABLE：禁用
 */
export const STATUS_ENUM = {
  ENABLE: 1,
  DISABLE: 0,
} as const;
export type STATUS_ENUM_TYPE = typeof STATUS_ENUM[keyof typeof STATUS_ENUM];

/**
 * 部门类型 COMPANY：公司 DEPT：部门 GROUP：小组
 */
export const DEPT_TYPE = {
  COMPANY: 'COMPANY',
  DEPT: 'DEPT',
  GROUP: 'GROUP',
} as const;
export type DEPT_TYPE_TYPE = typeof DEPT_TYPE[keyof typeof DEPT_TYPE];

/**
 * 性别 1：男 2：女 3：未知
 */
export const SEX_ENUM = {
  MAN: 1,
  WOMAN: 2,
  UNKNOWN: 3,
} as const;
export type SEX_ENUM_TYPE = typeof SEX_ENUM[keyof typeof SEX_ENUM];

/**
 * 通用状态
 * SUCCESS：成功
 * FAIL：失败
 */
export const COMMON_STATUS = {
  SUCCESS: 1,
  FAIL: 0,
} as const;
export type COMMON_STATUS_TYPE = typeof COMMON_STATUS[keyof typeof COMMON_STATUS];

/**
 * 上传状态
 */
export const UPLOAD_STATUS = {
  PENDING: 'pending',
  UPLOADING: 'uploading',
  COMPLETED: 'completed',
  FAILED: 'failed',
} as const;
export type UPLOAD_STATUS_TYPE = typeof UPLOAD_STATUS[keyof typeof UPLOAD_STATUS];

/**
 * 缓存键
 */
export const CACHE_KEY = {
  USER_INFO: 'LOGIN_USER_TOKEN:USER_INFO:',
  USER_MENU: 'LOGIN_USER_TOKEN:USER_MENU:',
  USER_BASE_INFO: "SYSTEM_CACHE:USER_INFO",
} as const;
export type CACHE_KEY_TYPE = typeof CACHE_KEY[keyof typeof CACHE_KEY];

/**
 * 请求方式
 */
export const REQUEST_METHOD = {
  GET: 'GET',
  POST: 'POST',
  PUT: 'PUT',
  DELETE: 'DELETE',
  PATCH: 'PATCH',
  HEAD: 'HEAD',
  OPTIONS: 'OPTIONS',
  TRACE: 'TRACE',
} as const;
export type REQUEST_METHOD_TYPE = typeof REQUEST_METHOD[keyof typeof REQUEST_METHOD];
